package com.itheima;

import com.itheima.config.SpringConfig;
import com.itheima.domain.Student;
import com.itheima.service.StudentService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class App {

    public static void main(String[] args) {
        //获取核心容器对象
        ApplicationContext app=new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取service
        StudentService service= (StudentService) app.getBean("studentService");

        Student stu10 = service.findById(10);
        stu10.setName("弥生");
        stu10.setAge(22);
        stu10.setScore(324);
        service.update(stu10);
        System.out.println(stu10);

    }
}
